<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
  Class: OpenTok::Archives
  
    &mdash; Documentation by YARD 0.8.7.6
  
</title>

  <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />

  <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  hasFrames = window.top.frames.main ? true : false;
  relpath = '../';
  framesUrl = "../frames.html#!OpenTok/Archives.html";
</script>


  <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>

  <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>


  </head>
  <body>
    <div id="header">
      <div id="menu">
  
    <a href="../_index.html">Index (A)</a> &raquo;
    <span class='title'><span class='object_link'><a href="../OpenTok.html" title="OpenTok (module)">OpenTok</a></span></span>
     &raquo; 
    <span class="title">Archives</span>
  

  <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  
    <a class="full_list_link" id="class_list_link"
        href="../class_list.html">
      Class List
    </a>
  
    <a class="full_list_link" id="method_list_link"
        href="../method_list.html">
      Method List
    </a>
  
    <a class="full_list_link" id="file_list_link"
        href="../file_list.html">
      File List
    </a>
  
</div>
      <div class="clear"></div>
    </div>

    <iframe id="search_frame"></iframe>

    <div id="content"><h1>Class: OpenTok::Archives
  
  
  
</h1>

<dl class="box">
  
    <dt class="r1">Inherits:</dt>
    <dd class="r1">
      <span class="inheritName">Object</span>
      
        <ul class="fullTree">
          <li>Object</li>
          
            <li class="next">OpenTok::Archives</li>
          
        </ul>
        <a href="#" class="inheritanceTree">show all</a>
      
      </dd>
    
  
  
    
  
    
  
  
  
    <dt class="r2 last">Defined in:</dt>
    <dd class="r2 last">lib/opentok/archives.rb</dd>
  
</dl>
<div class="clear"></div>

<h2>Overview</h2><div class="docstring">
  <div class="discussion">
    
<p>A class for working with OpenTok archives.</p>


  </div>
</div>
<div class="tags">
  

</div>






  
    <h2>
      Instance Method Summary
      <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
    </h2>

    <ul class="summary">
      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#all-instance_method" title="#all (instance method)">- (ArchiveList) <strong>all</strong>(options = {}) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Returns an ArchiveList, which is an array of archives that are completed
and in-progress, for your API key.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#create-instance_method" title="#create (instance method)">- (Archive) <strong>create</strong>(session_id, options = {}) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Starts archiving an OpenTok session.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#delete_by_id-instance_method" title="#delete_by_id (instance method)">- (Object) <strong>delete_by_id</strong>(archive_id) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Deletes an OpenTok archive.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#find-instance_method" title="#find (instance method)">- (Archive) <strong>find</strong>(archive_id) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Gets an Archive object for the given archive ID.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#stop_by_id-instance_method" title="#stop_by_id (instance method)">- (Archive) <strong>stop_by_id</strong>(archive_id) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Stops an OpenTok archive that is being recorded.</p>
</div></span>
  
</li>

      
    </ul>
  



  <div id="instance_method_details" class="method_details_list">
    <h2>Instance Method Details</h2>

    
      <div class="method_details first">
  <h3 class="signature first" id="all-instance_method">
  
    - (<tt><span class='object_link'><a href="ArchiveList.html" title="OpenTok::ArchiveList (class)">ArchiveList</a></span></tt>) <strong>all</strong>(options = {}) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Returns an ArchiveList, which is an array of archives that are completed
and in-progress, for your API key.</p>


  </div>
</div>
<div class="tags">
  <p class="tag_title">Parameters:</p>
<ul class="param">
  
    <li>
      
        <span class='name'>options</span>
      
      
        <span class='type'>(<tt>Hash</tt>)</span>
      
      
        <em class="default">(defaults to: <tt>{}</tt>)</em>
      
      
        &mdash;
        <div class='inline'>
<p>A hash with keys defining which range of archives to retrieve.</p>
</div>
      
    </li>
  
</ul>

  
    
    
    <p class="tag_title">Options Hash (<tt>options</tt>):</p>
    <ul class="option">
      
        <li>
          <span class="name">:offset</span>
          <span class="type">(<tt>integer</tt>)</span>
          <span class="default">
            
          </span>
          
            &mdash; <div class='inline'>
<p>Optional. The index offset of the first archive. 0 is offset of the most
recently started archive. 1 is the offset of the archive that started prior
to the most recent archive. If you do not specify an offset, 0 is used.</p>
</div>
          
        </li>
      
        <li>
          <span class="name">:count</span>
          <span class="type">(<tt>integer</tt>)</span>
          <span class="default">
            
          </span>
          
            &mdash; <div class='inline'>
<p>Optional. The number of archives to be returned. The maximum number of
archives returned is 1000.</p>
</div>
          
        </li>
      
    </ul>
  

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="ArchiveList.html" title="OpenTok::ArchiveList (class)">ArchiveList</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>An ArchiveList object, which is an array of Archive objects.</p>
</div>
      
    </li>
  
</ul>
<p class="tag_title">Raises:</p>
<ul class="raise">
  
    <li>
      
      
        <span class='type'>(<tt>ArgumentError</tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


101
102
103
104
105</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/opentok/archives.rb', line 101</span>

<span class='kw'>def</span> <span class='id identifier rubyid_all'>all</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Limit is invalid</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:count</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='kw'>or</span> <span class='lparen'>(</span><span class='int'>0</span><span class='op'>..</span><span class='int'>100</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:count</span><span class='rbracket'>]</span>
  <span class='id identifier rubyid_archive_list_json'>archive_list_json</span> <span class='op'>=</span> <span class='ivar'>@client</span><span class='period'>.</span><span class='id identifier rubyid_list_archives'>list_archives</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:offset</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:count</span><span class='rbracket'>]</span><span class='rparen'>)</span>
  <span class='const'>ArchiveList</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_archive_list_json'>archive_list_json</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="create-instance_method">
  
    - (<tt><span class='object_link'><a href="Archive.html" title="OpenTok::Archive (class)">Archive</a></span></tt>) <strong>create</strong>(session_id, options = {}) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Starts archiving an OpenTok session.</p>

<p>Clients must be actively connected to the OpenTok session for you to
successfully start recording an archive.</p>

<p>You can only record one archive at a time for a given session. You can only
record archives of sessions that use the OpenTok Media Router (sessions
with the media mode set to routed); you cannot archive sessions with the
media mode set to relayed.</p>

<p>For more information on archiving, see the
<a href="https://tokbox.com/opentok/tutorials/archiving" target="_parent" title="OpenTok archiving">OpenTok archiving</a>
programming guide.</p>

<p>:name.</p>


  </div>
</div>
<div class="tags">
  <p class="tag_title">Parameters:</p>
<ul class="param">
  
    <li>
      
        <span class='name'>session_id</span>
      
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>The session ID of the OpenTok session to archive.</p>
</div>
      
    </li>
  
    <li>
      
        <span class='name'>options</span>
      
      
        <span class='type'>(<tt>Hash</tt>)</span>
      
      
        <em class="default">(defaults to: <tt>{}</tt>)</em>
      
      
        &mdash;
        <div class='inline'>
<p>A hash with the key ‘name’, ‘has_audio’, and ‘has_video’ (or</p>
</div>
      
    </li>
  
</ul>

  
    
    
    
    
    <p class="tag_title">Options Hash (<tt>options</tt>):</p>
    <ul class="option">
      
        <li>
          <span class="name">:name</span>
          <span class="type">(<tt>String</tt>)</span>
          <span class="default">
            
          </span>
          
            &mdash; <div class='inline'>
<p>This is the name of the archive. You can use this name to identify the
archive. It is a property of the Archive object, and it is a property of
archive-related events in the OpenTok client SDKs.</p>
</div>
          
        </li>
      
        <li>
          <span class="name">:has_audio</span>
          <span class="type">(<tt>true</tt>, <tt>false</tt>)</span>
          <span class="default">
            
          </span>
          
            &mdash; <div class='inline'>
<p>Whether the archive will include an audio track (<tt>true</tt>) or not
<tt>false</tt>). The default value is <tt>true</tt> (an audio track is
included). If you set both  <tt>has_audio</tt> and <tt>has_video</tt> to
<tt>false</tt>, the call to the <tt>create()</tt> method results in an
error.</p>
</div>
          
        </li>
      
        <li>
          <span class="name">:has_video</span>
          <span class="type">(<tt>true</tt>, <tt>false</tt>)</span>
          <span class="default">
            
          </span>
          
            &mdash; <div class='inline'>
<p>Whether the archive will include a video track (<tt>true</tt>) or not
<tt>false</tt>). The default value is <tt>true</tt> (a video track is
included). If you set both  <tt>has_audio</tt> and <tt>has_video</tt> to
<tt>false</tt>, the call to the <tt>create()</tt> method results in an
error.</p>
</div>
          
        </li>
      
        <li>
          <span class="name">:output_mode</span>
          <span class="type">(<tt>String</tt>)</span>
          <span class="default">
            
          </span>
          
            &mdash; <div class='inline'>
<p>Whether all streams in the archive are recorded to a single file
(<tt>:composed</tt>, the default) or to individual files
(<tt>:individual</tt>). For more information on archiving and the archive
file formats, see the <a href="https://tokbox.com/opentok/tutorials/archiving" target="_parent" title="OpenTok archiving">OpenTok archiving</a> programming guide.</p>
</div>
          
        </li>
      
    </ul>
  

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="Archive.html" title="OpenTok::Archive (class)">Archive</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>The Archive object, which includes properties defining the archive,
including the archive ID.</p>
</div>
      
    </li>
  
</ul>
<p class="tag_title">Raises:</p>
<ul class="raise">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="OpenTokArchiveError.html" title="OpenTok::OpenTokArchiveError (class)">OpenTokArchiveError</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>The archive could not be started. The request was invalid or the session
has no connected clients.</p>
</div>
      
    </li>
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="OpenTokAuthenticationError.html" title="OpenTok::OpenTokAuthenticationError (class)">OpenTokAuthenticationError</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>Authentication failed while starting an archive. Invalid API key.</p>
</div>
      
    </li>
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="OpenTokArchiveError.html" title="OpenTok::OpenTokArchiveError (class)">OpenTokArchiveError</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>The archive could not be started. The session ID does not exist.</p>
</div>
      
    </li>
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="OpenTokArchiveError.html" title="OpenTok::OpenTokArchiveError (class)">OpenTokArchiveError</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>The archive could not be started. The session could be peer-to-peer or the
session is already being recorded.</p>
</div>
      
    </li>
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="OpenTokArchiveError.html" title="OpenTok::OpenTokArchiveError (class)">OpenTokArchiveError</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>The archive could not be started.</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


59
60
61
62
63
64
65
66
67
68
69
70
71
72
73</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/opentok/archives.rb', line 59</span>

<span class='kw'>def</span> <span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='id identifier rubyid_session_id'>session_id</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>session_id not provided</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_session_id'>session_id</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>

  <span class='comment'># normalize opts so all keys are symbols and only include valid_opts
</span>  <span class='id identifier rubyid_valid_opts'>valid_opts</span> <span class='op'>=</span> <span class='lbracket'>[</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='symbol'>:has_audio</span><span class='comma'>,</span> <span class='symbol'>:has_video</span><span class='comma'>,</span> <span class='symbol'>:output_mode</span> <span class='rbracket'>]</span>
  <span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_inject'>inject</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_m'>m</span><span class='comma'>,</span><span class='lparen'>(</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span><span class='id identifier rubyid_v'>v</span><span class='rparen'>)</span><span class='op'>|</span>
    <span class='kw'>if</span> <span class='id identifier rubyid_valid_opts'>valid_opts</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_k'>k</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span>
      <span class='id identifier rubyid_m'>m</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_v'>v</span>
    <span class='kw'>end</span>
    <span class='id identifier rubyid_m'>m</span>
  <span class='kw'>end</span>

  <span class='id identifier rubyid_archive_json'>archive_json</span> <span class='op'>=</span> <span class='ivar'>@client</span><span class='period'>.</span><span class='id identifier rubyid_start_archive'>start_archive</span><span class='lparen'>(</span><span class='id identifier rubyid_session_id'>session_id</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
  <span class='const'>Archive</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_archive_json'>archive_json</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="delete_by_id-instance_method">
  
    - (<tt>Object</tt>) <strong>delete_by_id</strong>(archive_id) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Deletes an OpenTok archive.</p>

<p>You can only delete an archive which has a status of "available",
"uploaded", or "deleted". Deleting an archive removes its record from the
list of archives. For an "available" archive, it also removes the archive
file, making it unavailable for download. For a "deleted" archive, the
archive remains deleted.</p>


  </div>
</div>
<div class="tags">
  <p class="tag_title">Parameters:</p>
<ul class="param">
  
    <li>
      
        <span class='name'>archive_id</span>
      
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>The archive ID of the archive you want to delete.</p>
</div>
      
    </li>
  
</ul>

<p class="tag_title">Raises:</p>
<ul class="raise">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="OpenTokAuthenticationError.html" title="OpenTok::OpenTokAuthenticationError (class)">OpenTokAuthenticationError</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>Authentication failed or an invalid archive ID was given.</p>
</div>
      
    </li>
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="OpenTokArchiveError.html" title="OpenTok::OpenTokArchiveError (class)">OpenTokArchiveError</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>The archive could not be deleted. The status must be ‘available’,
‘deleted’, or ‘uploaded’.</p>
</div>
      
    </li>
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="OpenTokArchiveError.html" title="OpenTok::OpenTokArchiveError (class)">OpenTokArchiveError</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>The archive could not be deleted.</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


141
142
143
144
145</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/opentok/archives.rb', line 141</span>

<span class='kw'>def</span> <span class='id identifier rubyid_delete_by_id'>delete_by_id</span><span class='lparen'>(</span><span class='id identifier rubyid_archive_id'>archive_id</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>archive_id not provided</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_archive_id'>archive_id</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
  <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='ivar'>@client</span><span class='period'>.</span><span class='id identifier rubyid_delete_archive'>delete_archive</span><span class='lparen'>(</span><span class='id identifier rubyid_archive_id'>archive_id</span><span class='rparen'>)</span>
  <span class='lparen'>(</span><span class='int'>200</span><span class='op'>..</span><span class='int'>300</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_code'>code</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="find-instance_method">
  
    - (<tt><span class='object_link'><a href="Archive.html" title="OpenTok::Archive (class)">Archive</a></span></tt>) <strong>find</strong>(archive_id) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Gets an Archive object for the given archive ID.</p>


  </div>
</div>
<div class="tags">
  <p class="tag_title">Parameters:</p>
<ul class="param">
  
    <li>
      
        <span class='name'>archive_id</span>
      
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>The archive ID.</p>
</div>
      
    </li>
  
</ul>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="Archive.html" title="OpenTok::Archive (class)">Archive</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>The Archive object.</p>
</div>
      
    </li>
  
</ul>
<p class="tag_title">Raises:</p>
<ul class="raise">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="OpenTokArchiveError.html" title="OpenTok::OpenTokArchiveError (class)">OpenTokArchiveError</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>The archive could not be retrieved. The archive ID is invalid.</p>
</div>
      
    </li>
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="OpenTokAuthenticationError.html" title="OpenTok::OpenTokAuthenticationError (class)">OpenTokAuthenticationError</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>Authentication failed while retrieving the archive. Invalid API key.</p>
</div>
      
    </li>
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="OpenTokArchiveError.html" title="OpenTok::OpenTokArchiveError (class)">OpenTokArchiveError</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>The archive could not be retrieved.</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


84
85
86
87
88</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/opentok/archives.rb', line 84</span>

<span class='kw'>def</span> <span class='id identifier rubyid_find'>find</span><span class='lparen'>(</span><span class='id identifier rubyid_archive_id'>archive_id</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>archive_id not provided</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_archive_id'>archive_id</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
  <span class='id identifier rubyid_archive_json'>archive_json</span> <span class='op'>=</span> <span class='ivar'>@client</span><span class='period'>.</span><span class='id identifier rubyid_get_archive'>get_archive</span><span class='lparen'>(</span><span class='id identifier rubyid_archive_id'>archive_id</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rparen'>)</span>
  <span class='const'>Archive</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_archive_json'>archive_json</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="stop_by_id-instance_method">
  
    - (<tt><span class='object_link'><a href="Archive.html" title="OpenTok::Archive (class)">Archive</a></span></tt>) <strong>stop_by_id</strong>(archive_id) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Stops an OpenTok archive that is being recorded.</p>

<p>Archives automatically stop recording after 90 minutes or when all clients
have disconnected from the session being archived.</p>


  </div>
</div>
<div class="tags">
  <p class="tag_title">Parameters:</p>
<ul class="param">
  
    <li>
      
        <span class='name'>archive_id</span>
      
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>The archive ID of the archive you want to stop recording.</p>
</div>
      
    </li>
  
</ul>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="Archive.html" title="OpenTok::Archive (class)">Archive</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>The Archive object corresponding to the archive being stopped.</p>
</div>
      
    </li>
  
</ul>
<p class="tag_title">Raises:</p>
<ul class="raise">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="OpenTokArchiveError.html" title="OpenTok::OpenTokArchiveError (class)">OpenTokArchiveError</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>The archive could not be stopped. The request was invalid.</p>
</div>
      
    </li>
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="OpenTokAuthenticationError.html" title="OpenTok::OpenTokAuthenticationError (class)">OpenTokAuthenticationError</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>Authentication failed while stopping an archive.</p>
</div>
      
    </li>
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="OpenTokArchiveError.html" title="OpenTok::OpenTokArchiveError (class)">OpenTokArchiveError</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>The archive could not be stopped. The archive ID does not exist.</p>
</div>
      
    </li>
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="OpenTokArchiveError.html" title="OpenTok::OpenTokArchiveError (class)">OpenTokArchiveError</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>The archive could not be stopped. The archive is not currently recording.</p>
</div>
      
    </li>
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="OpenTokArchiveError.html" title="OpenTok::OpenTokArchiveError (class)">OpenTokArchiveError</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>The archive could not be started.</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


122
123
124
125
126</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/opentok/archives.rb', line 122</span>

<span class='kw'>def</span> <span class='id identifier rubyid_stop_by_id'>stop_by_id</span><span class='lparen'>(</span><span class='id identifier rubyid_archive_id'>archive_id</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>archive_id not provided</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_archive_id'>archive_id</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
  <span class='id identifier rubyid_archive_json'>archive_json</span> <span class='op'>=</span> <span class='ivar'>@client</span><span class='period'>.</span><span class='id identifier rubyid_stop_archive'>stop_archive</span><span class='lparen'>(</span><span class='id identifier rubyid_archive_id'>archive_id</span><span class='rparen'>)</span>
  <span class='const'>Archive</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_archive_json'>archive_json</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>

    <div id="footer">
  Generated on Mon May 25 15:52:46 2015 by
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
  0.8.7.6 (ruby-1.9.3).
</div>

  </body>
</html>